package com.atguigu.yygh.enums;

/**
 * @author mgx
 * @version 1.0
 * @description: TODO
 * @date 2022/9/3 22:12
 */
public enum StatusEnum {

    LOCK(0, "锁定"),
    NORMAL(1, "正常")
    ;

    private Integer status;
    private String statusString;

    StatusEnum(Integer status, String statusString) {
        this.status = status;
        this.statusString = statusString;
    }

    public static String getStatusStringByStatus(Integer status) {
        StatusEnum[] values = StatusEnum.values();
        for (StatusEnum value : values) {
            if(value.getStatus().intValue() == status.intValue()) {
                return value.statusString;
            }
        }
        return "";
    }

    @Override
    public String toString() {
        return "StatusEnum{" +
                "status=" + status +
                ", statusString='" + statusString + '\'' +
                '}';
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getStatusString() {
        return statusString;
    }

    public void setStatusString(String statusString) {
        this.statusString = statusString;
    }
}
